<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="g" uri="http://geni-max.com/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
		<meta http-equiv="Cache-Control" content="no-cache" />
		<meta http-equiv="Expires" content="0" />
		<title>卓越网络管理系统</title>
		<link rel="stylesheet" type="text/css" href="../css/public.css" />
		<script type="text/javascript" src="../js/Form.js"></script>
		<script type="text/javascript" src="../js/Calendar.js"></script>
		<script type="text/javascript" src="../js/ext-3.0.3/adapter/ext/ext-base.js" charset="UTF-8"></script>
		<script type="text/javascript" src="../js/ext-3.0.3/ext-all-debug.js" charset="UTF-8"></script>
		<script type="text/javascript" src="../js/ext-3.0.3/source/locale/ext-lang-zh_CN.js" charset="UTF-8"></script>
		<script type="text/javascript" src="../js/jquery.js" charset="UTF-8"></script>
        <link rel="stylesheet" type="text/css" href="../js/jquery/validate/jquery.validate.css" />
        <script type="text/javascript" src="../js/jquery/validate/jquery.validate.js" charset="UTF-8"></script>
	</head>
	<body>
		<table class="tab">
			<jsp:include page="base_info_gcblx.jsp" />
			<jsp:include page="base_info2.jsp" />
		</table>
		<form id="tform" method="post" onsubmit="return checkForm()" action="roomProject!process.action" style="margin-top:1px;">
			<input type="hidden" name="id" value="${roomProject.id}" />
			<input type="hidden" name="taskId" value="${taskId}" />
				<table class="tab">
				<tr>
					<td class="label" width="10%">前期落实：</td>
					<td width="10%">
						<select name="roomProject.practicalEarly" size="1" id="practicalearly">
							<option value="">--请选择--</option>
							<option value="true" <c:if test="${roomProject.practicalEarly eq true}">selected="selected"</c:if>>是</option>
							<option value="false" <c:if test="${roomProject.practicalEarly eq false}">selected="selected"</c:if>>否</option>
						</select>
					</td>
					<td class="label" width="10%">是否土建：</td>
					<td id="needcivil" width="10%">
						<c:if test="${roomProject.needCivil eq true}">
							是
						</c:if>
						<c:if test="${roomProject.needCivil eq false}">
							否
						</c:if>
					</td>
					<td class="label" width="10%">土建费用：</td>
					<td width="10%"><input size="8" maxlength="16" name="roomProject.civilCost" dataType="integer" value=0 id="civilcost" /></td>
					<td class="label" width="10%">土建施工单位：</td>
					<td width="10%"><input size="8" maxlength="20" name="roomProject.civilBuildUnit" value="" id="civilbuildunit" /></td>
				</tr>
				<tr>
					<td class="label">美化体类型：</td>
					<td><input size="8" maxlength="20" name="roomProject.bodycareType" value="" id="bodycaretype"/></td>
					<td class="label">美化体施工单位：</td>
					<td><input size="8" maxlength="20" name="roomProject.bodycareFactory" value="" id="bodycarefactory"/></td>
					<td class="label">美化体费用：</td>
					<td><input size="8" maxlength="16" name="roomProject.bodycareCost" dataType="integer" value=0 id="bodycarecost"/></td>
					<td class="label">甲供材料：</td>
					<td><input size="8" maxlength="16" name="roomProject.transferMaterial" value="" id="transferMaterial" /></td>
				</tr>
				<tr>
					<td class="label">覆盖延伸施工单位：</td>
					<td><input size="8" maxlength="20" name="roomProject.fgysBuildUnit" value="" id="fgysbuildunit"/></td>
					<td class="label">覆盖延伸施工费用：</td>
					<td><input size="8" maxlength="16" name="roomProject.fgysBuildConst" dataType="integer" value=0 id="fgysbuildconst"/></td>
					<td class="label">覆盖延伸预算总金额：</td>
					<td><input size="8" maxlength="16" name="roomProject.fgysBudgetTotal" dataType="integer" value=0 id="fgysbudgettotal"/></td>
					<td class="label">甲供材料费用：</td>
					<td><input size="8" maxlength="16" name="roomProject.transferMaterialCost"  dataType="integer" value=0 id="transfermaterialcost"/></td>
				</tr>
				<tr>
                	<td class="label">传输是否新建：</td>
					<td >
						<select name="roomProject.newTransfer" size="1" id="newtransfer">
							<option value="">--请选择--</option>
							<option value="true" <c:if test="${roomProject.newTransfer eq true}">selected="selected"</c:if>>是</option>
							<option value="false" <c:if test="${roomProject.newTransfer eq false}">selected="selected"</c:if>>否</option>
						</select>
					</td>
					<td class="label">动力是否配套：</td>
					<td >
						<select name="roomProject.horsePowerSuit" size="1" id="horsepowersuit"> 
							<option value="">--请选择--</option>
							<option value="true" <c:if test="${roomProject.horsePowerSuit eq true}">selected="selected"</c:if>>是</option>
							<option value="false" <c:if test="${roomProject.horsePowerSuit eq false}">selected="selected"</c:if>>否</option>
						</select>
					</td>
					<td class="label" width="12%">项目完成时间：</td>
					<td >
						<input size="8" maxlength="20" readonly="readonly" style="cursor:text;" onclick="showDateGrid(this)" maxlength="64" name="roomProject.itemFinishedTime" value="${roomProject.itemFinishedTime}" id="itemfinishedtime"/>
					</td>
				</tr>
				<tr>
					<td class="label">直放站材料：</td>
					<td><input size="8" maxlength="20" name="roomProject.repeaterMaterial" value="" id="zfzmaterial" /></td>
					<td class="label">直放站施工费用：</td>
					<td><input size="8" maxlength="16" name="roomProject.repeaterBuildCost" dataType="integer" value=0 id="zfzbuildcost" /></td>
					<td class="label">直放站预算总金额：</td>
					<td><input size="8" maxlength="16" name="roomProject.repeaterBudgetTotal" dataType="integer" value=0 id="zfzbudgettotal" /></td>
					<td class="label">直放站施工单位：</td>
					<td><input size="8" maxlength="20" name="roomProject.repeaterBuildFactory" value="" id="zfzbuildunit" /></td>
				</tr>
				<tr>
					<td class="label">操作说明：</td>
					<td colspan="7">
						<textarea rows="3" name="operateRemark"></textarea>
					</td>
				</tr>
				<tr>
					<td colspan="8" class="tcenter">
						<input type="hidden" id="actionName" name="actionName" value="提交" />
						<button type="submit" onclick="document.getElementById('actionName').value = '提交'">提交</button>
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>
<script language="javascript"><!--
function checkForm() {
	var practicalearly = document.getElementById('practicalearly').value;
	var needcivil = "${roomProject.needCivil}";
	var civilCost = document.getElementById('civilcost').value;
	var civilbuildunit = document.getElementById('civilbuildunit').value;
	var manufacturer = document.getElementById('manufacturer').value;
	var materialcost = document.getElementById('materialcost').value;
	var constructioncost = document.getElementById('constructioncost').value;
	var constructionunit = document.getElementById('constructionunit').value;

//	var bodycaretype = document.getElementById('bodycaretype').value;
//	var bodycarefactory = document.getElementById('bodycarefactory').value;
//	var bodycarecost = document.getElementById('bodycarecost').value;
	var transfermaterialcost = document.getElementById('transfermaterialcost').value;
	var fgysbuildunit = document.getElementById('fgysbuildunit').value;
	var fgysbuildconst = document.getElementById('fgysbuildconst').value;
	var fgysbudgettotal = document.getElementById('fgysbudgettotal').value;
	var newtransfer = document.getElementById('newtransfer').value;
	var horsepowersuit = document.getElementById('horsepowersuit').value;
	var itemfinishedtime = document.getElementById('itemfinishedtime').value;

	var zfzmaterial = document.getElementById('zfzmaterial').value;
	var zfzbuildunit = document.getElementById('zfzbuildunit').value;
	var zfzbuildcost = document.getElementById('zfzbuildcost').value;
	var zfzbudgettotal = document.getElementById('zfzbudgettotal').value;
	var gsmtype = "${roomProject.gsmBuildType}";
	if(practicalearly == null || practicalearly ==''){
		alert("前期是否落实不可以为空");
		document.getElementById('practicalearly').focus();
		return false;
	}
	if(needcivil == 'true'){
		if(civilCost == null || civilCost ==""){
			alert("土建费用不可以为空");
			document.getElementById('civilcost').focus();
			return false;
		}
		if(civilbuildunit == null || civilbuildunit == ""){
			alert("土建施工单位不可以为空");
			document.getElementById('civilbuildunit').focus();
			return false;
		}
	}
	/*if(manufacturer == null || manufacturer ==''){
		alert("厂家不可以为空，请选择厂家");
		document.getElementById('manufacturer').focus();
		return false;
	}
	if(materialcost == null || materialcost ==''){
		alert("集成材料费不可以为空");
		document.getElementById('materialcost').focus();
		return false;
	}
	if(constructioncost == null || constructioncost ==''){
		alert("集成施工费不可以为空");
		document.getElementById('constructioncost').focus();
		return false;
	}
	if(constructionunit == null || constructionunit ==''){
		alert("施工单位不可以为空");
		document.getElementById('constructionunit').focus();
		return false;
	}

	if(bodycaretype == null || bodycaretype ==''){
		alert("美化体类型不可以为空");
		document.getElementById('bodycaretype').focus();
		return false;
	}
	if(bodycarefactory == null || bodycarefactory ==''){
		alert("美化体施工单位不可以为空");
		document.getElementById('bodycarefactory').focus();
		return false;
	}
	if(bodycarecost == null || bodycarecost ==''){
		alert("美化体费用不可以为空");
		document.getElementById('bodycarecost').focus();
		return false;
	}
*/
	if(transfermaterialcost == null || transfermaterialcost ==''){
		alert("甲供材料费用不可以为空");
		document.getElementById('transfermaterialcost').focus();
		return false;
	}
	if(fgysbuildunit == null || fgysbuildunit ==''){
		alert("覆盖延伸施工单位不可以为空");
		document.getElementById('fgysbuildunit').focus();
		return false;
	}
	if(fgysbuildconst == null || fgysbuildconst ==''){
		alert("覆盖延伸施工费用不可以为空");
		document.getElementById('fgysbuildconst').focus();
		return false;
	}
	if(fgysbudgettotal == null || fgysbudgettotal ==''){
		alert("覆盖延伸预算总金额不可以为空");
		document.getElementById('fgysbudgettotal').focus();
		return false;
	}
	if(newtransfer == null || newtransfer ==''){
		alert("传输是否新建不可以为空");
		document.getElementById('newtransfer').focus();
		return false;
	}
	if(horsepowersuit == null || horsepowersuit ==''){
		alert("动力是否配套不可以为空");
		document.getElementById('horsepowersuit').focus();
		return false;
	}
	if(itemfinishedtime == null || itemfinishedtime ==''){
		alert("项目完成时间不可以为空"); 
		document.getElementById('itemfinishedtime').focus();
		return false;
	}


	if(gsmtype != null && gsmtype != "" && gsmtype.indexOf('直放站') != -1){
		if(zfzmaterial == null || zfzmaterial ==''){
			alert("直放站材料不可以为空");
			document.getElementById('zfzmaterial').focus();
			return false;
		}
		if(zfzbuildunit == null || zfzbuildunit ==''){
			alert("直放站施工单位不可以为空");
			document.getElementById('zfzbuildunit').focus();
			return false;
		}
		if(zfzbuildcost == null || zfzbuildcost ==''){
			alert("直放站施工费用不可以为空");
			document.getElementById('zfzbuildcost').focus();
			return false;
		}

		if(zfzbudgettotal == null || zfzbudgettotal ==''){
			alert("直放站预算总金额不可以为空");
			document.getElementById('zfzbudgettotal').focus();
			return false;
		}
	}
	return true;
}

Ext.onReady(function() {
	var gsmtype = "${roomProject.gsmBuildType}";
	var needcivil = "${roomProject.needCivil}";
	if(needcivil == 'false'){
		document.getElementById('civilcost').value = '土建费用';
		document.getElementById('civilcost').disabled = true;
		document.getElementById('civilbuildunit').value = '土建施工单位';
		document.getElementById('civilbuildunit').disabled = true;
	}else{
		document.getElementById('civilcost').disabled = false;
		document.getElementById('civilbuildunit').disabled = false;
	}
	
	if(gsmtype != null && gsmtype != "" && gsmtype.indexOf('直放站') != -1){
		document.getElementById('zfzmaterial').disabled = false;
		document.getElementById('zfzbuildunit').disabled = false;
		document.getElementById('zfzbuildcost').disabled = false;
		document.getElementById('zfzbudgettotal').disabled = false;
	}else{
		document.getElementById('zfzmaterial').value = '直放站材料';
		document.getElementById('zfzmaterial').disabled = true;
		document.getElementById('zfzbuildunit').value = '直放站施工单位';
		document.getElementById('zfzbuildunit').disabled = true;
		document.getElementById('zfzbuildcost').value = '直放站施工费用';
		document.getElementById('zfzbuildcost').disabled = true;
		document.getElementById('zfzbudgettotal').value = '直放站预算总金额';
		document.getElementById('zfzbudgettotal').disabled = true;
	}
	var re=/^(0|([+,-]?[1-9]\d*))(\.\d*)?$/;//验证数字(包括小数)
	$("#civilcost").blur(function(){
		if(!re.test($(this).val())){
			$(this).css("background","#fff0f0").css("border","1px solid #ff0000").focus();
			alert("请输入数字");
			return;
		}else{
			$(this).css("background","#ffffff").css("border","solid 1px #8DB2E3");
		}
		/*else{
			if($(this).val()>500000){
				$(this).css("background","#fff0f0").css("border","1px solid #ff0000").focus();;
				alert("金额不能大于50万")
				return;
			}else{
				$(this).css("background","#ffffff").css("border","solid 1px #8DB2E3");
			}
		}*/
	});
	$("#bodycarecost").blur(function(){
		if(!re.test($(this).val())){
			$(this).css("background","#fff0f0").css("border","1px solid #ff0000").focus();
			alert("请输入数字");
			return;
		}else{
			$(this).css("background","#ffffff").css("border","solid 1px #8DB2E3");
		}
		/*else{
			if($(this).val()>500000){
				$(this).css("background","#fff0f0").css("border","1px solid #ff0000").focus();;
				alert("金额不能大于50万")
				return;
			}else{
				$(this).css("background","#ffffff").css("border","solid 1px #8DB2E3");
			}
		}*/
	});
	$('#transfermaterialcost').blur(function(){
		if(!re.test($(this).val())){
			$(this).css("background","#fff0f0").css("border","1px solid #ff0000").focus();
			alert("请输入数字");
			return;
		}else{
			$(this).css("background","#ffffff").css("border","solid 1px #8DB2E3");
		}
		/*else{
			if($(this).val()>500000){
				$(this).css("background","#fff0f0").css("border","1px solid #ff0000").focus();;
				alert("金额不能大于50万")
				return;
			}else{
				$(this).css("background","#ffffff").css("border","solid 1px #8DB2E3");
			}
		}*/
	});
	$('#fgysbuildconst').blur(function(){
		if(!re.test($(this).val())){
			$(this).css("background","#fff0f0").css("border","1px solid #ff0000").focus();
			alert("请输入数字");
			return;
		}else{
			if($(this).val()>500000){
				$(this).css("background","#fff0f0").css("border","1px solid #ff0000").focus();;
				alert("金额不能大于50万")
				return;
			}else{
				$(this).css("background","#ffffff").css("border","solid 1px #8DB2E3");
			}
		}
	});
	$('#fgysbudgettotal').blur(function(){
		if(!re.test($(this).val())){
			$(this).css("background","#fff0f0").css("border","1px solid #ff0000").focus();
			alert("请输入数字");
			return;
		}else{
			$(this).css("background","#ffffff").css("border","solid 1px #8DB2E3");
		}
		/*else{
			if($(this).val()>500000){
				$(this).css("background","#fff0f0").css("border","1px solid #ff0000").focus();;
				alert("金额不能大于50万")
				return;
			}else{
				$(this).css("background","#ffffff").css("border","solid 1px #8DB2E3");
			}
		}*/
	});
	$('#zfzbuildcost').blur(function(){
		if(!re.test($(this).val())){
			$(this).css("background","#fff0f0").css("border","1px solid #ff0000").focus();
			alert("请输入数字");
			return;
		}else{
			if($(this).val()>500000){
				$(this).css("background","#fff0f0").css("border","1px solid #ff0000").focus();;
				alert("金额不能大于50万")
				return;
			}else{
				$(this).css("background","#ffffff").css("border","solid 1px #8DB2E3");
			}
		}
	});
	$('#zfzbudgettotal').blur(function(){
		if(!re.test($(this).val())){
			$(this).css("background","#fff0f0").css("border","1px solid #ff0000").focus();
			alert("请输入数字");
			return;
		}else{
			$(this).css("background","#ffffff").css("border","solid 1px #8DB2E3");
		}
		/*else{
			if($(this).val()>500000){
				$(this).css("background","#fff0f0").css("border","1px solid #ff0000").focus();;
				alert("金额不能大于50万")
				return;
			}else{
				$(this).css("background","#ffffff").css("border","solid 1px #8DB2E3");
			}
		}*/
	});
});

--></script>